package com.feign.wugongbang.service;

import com.feign.wugongbang.config.FeignFullLogConfiguration;
import com.feign.wugongbang.entity.WgbErrorCollection;
import com.feign.wugongbang.hystric.ErrorCollctionServiceHystric;
import com.feign.wugongbang.utils.BaseResult;
import com.feign.wugongbang.utils.Constants;
import com.feign.wugongbang.utils.PageInfo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * Created by Administrator on 2017/5/24.
 */
@FeignClient(name = "${service.name.wugongbang:"+Constants.SERVICE_NAME+"}",configuration = FeignFullLogConfiguration.class,fallback = ErrorCollctionServiceHystric.class)
public interface ErrorCollctionService {

    String PRE_URL = Constants.CODE_VERSION + "/errorCollction";

    @RequestMapping(value = PRE_URL + "/insert",method = RequestMethod.POST)
    Object insert(@RequestParam Map<String, Object> map) throws Exception;

    @RequestMapping(value = PRE_URL + "/selectByPrimaryKey",method = RequestMethod.GET)
    Object selectByPrimaryKey(@RequestParam("id") String id);

    @RequestMapping(value = PRE_URL + "/updateByPrimaryKey",method = RequestMethod.POST)
    Object updateByPrimaryKey(@RequestParam Map<String, Object> map) throws Exception ;

    @RequestMapping(value = PRE_URL + "/selectAll",method = RequestMethod.POST)
    Object selectAll(@RequestBody PageInfo pageInfo);

    @RequestMapping(value = PRE_URL + "/deleteByPrimaryKey",method = RequestMethod.GET)
    Object deleteByPrimaryKey(@RequestParam("id") String id);
}
